package cn.wolfcode.crm.service.imp;

import cn.wolfcode.crm.domain.FamilyCondition;
import cn.wolfcode.crm.mapper.FamilyconditionMapper;
import cn.wolfcode.crm.service.IFamilyConditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FamilyConditionServiceImpl implements IFamilyConditionService {
    @Autowired
    private FamilyconditionMapper familyconditionMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return familyconditionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public FamilyCondition selectByPrimaryKey(Long id) {
        return familyconditionMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateByPrimaryKey(FamilyCondition record) {
        if (record.getId() != null) {
            //更新操作
            familyconditionMapper.updateByPrimaryKey(record);


        } else {

            familyconditionMapper.insert(record);
        }
    }

    @Override
    public List<FamilyCondition> selectAll() {
        return familyconditionMapper.selectAll();
    }
}
